Piano notes book, powered by Astro and React.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

20 rindas
545 B

  1. ---
  2. import { getCollection } from 'astro:content';
  3. import Layout from '../../content/layouts/Appendix.astro';
  4. export const getStaticPaths = async () => {
  5. const entries = await getCollection('appendices');
  6. return entries.map(entry => ({
  7. params: { slug: entry.slug }, props: { entry },
  8. }));
  9. }
  10. const { entry } = Astro.props;
  11. const { Content } = await entry.render();
  12. const titlePrefix = String.fromCharCode(parseInt(entry.slug) - 1 + 65);
  13. ---
  14. <Layout title={entry.data.title} titlePrefix={`Appendix ${titlePrefix}`}>
  15. <Content />
  16. </Layout>